const currentMode = 'prod';// 根据当前环境更新配置,若要更新环境常量，修改这个值就行；

const configByMode = {
  local: {
    requestURL: 'http://192.168.50.239:83/api',
    PMCP_URL: 'https://pre-pmcp.feifanxinli.com/middlegroundapi',
    socketURL: 'wss://127.0.0.1:83/api/websocket/chat/',
    // wss://dev-tk.wanxinkeji.net/api/websocket/chat/
  },
  other: {
    requestURL: 'http://192.168.50.249:83/api',
    PMCP_URL: 'https://pre-pmcp.feifanxinli.com/middlegroundapi',
  },
  dev: { 
    requestURL: 'https://dev-tk.wanxinkeji.net/api',
    PMCP_URL: 'https://pre-pmcp.feifanxinli.com/middlegroundapi',
    socketURL: 'wss://dev-tk.wanxinkeji.net/api/websocket/chat/',
  },
  pre: {
    requestURL: 'https://pre-tk.wanxinkeji.net/api',
    PMCP_URL: 'https://pre-pmcp.feifanxinli.com/middlegroundapi',
    socketURL: 'wss://dev-tk.wanxinkeji.net/api/websocket/chat/',
  },
  prod: {
    requestURL: 'https://tk.wanxinkeji.net/api',
    PMCP_URL: 'https://pmcp.feifanxinli.com/middlegroundapi',
    socketURL: 'wss://tk.wanxinkeji.net/api/websocket/chat/',
  }
};

//所有环境必须包含该对象中的属性,‘ENV_DATA’对象中为null的需在‘configByMode’对象中定义
const ENV_DATA = {
  ['imgBaseURL']: 'https://webstatic.feifanxinli.com/talkTimeUserClient/images',//部分静态资源存储服务器上
  ['imgWxkjUrl']: 'https://img-wxkj.feifanxinli.com/consult/zx11/static/images',//部分静态资源存储oss上
  ['weixinPayAppId']: 'wx029883bef7f1706f',
  ['weixinAppId']: 'wx029883bef7f1706f',
  ['requestURL']: null, //接口请求地址
  ['PMCP_URL']: null, //阿里云STS相关配置接口地址
  ['SERVER_PHONE']: 19121186182,
  ['userInfoStorage']: 'userInfoClientUser',//缓存信息
  ['socketURL']: null,
}
//所有环境必须包含该对象中的属性 

Object.assign(ENV_DATA, configByMode[currentMode]);
// 导出需要的变量
export const { imgBaseURL } = ENV_DATA;
export const { imgWxkjUrl } = ENV_DATA;
export const { weixinPayAppId } = ENV_DATA;
export const { weixinAppId } = ENV_DATA;
export const { SERVER_PHONE } = ENV_DATA;
export const { requestURL } = ENV_DATA;
export const { PMCP_URL } = ENV_DATA;
export const { userInfoStorage } = ENV_DATA;
export const { socketURL } = ENV_DATA;